From b8c49ef536d4cb284d44b79a33e8ce232fcda326 Mon Sep 17 00:00:00 2001 From: robertl Date: Sat, 20 Dec 2003 05:39:13 +0000 Subject: [PATCH] Be nicer in absence of a shortname. --- gpsbabel/mapsend.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gpsbabel/mapsend.c b/gpsbabel/mapsend.c index 23af6e9e0..e9e1f2ff8 100644 --- a/gpsbabel/mapsend.c +++ b/gpsbabel/mapsend.c @@ -401,7 +401,7 @@ mapsend_waypt_pr(const waypoint *waypointp) mkshort(mkshort_handle, waypointp->description) : waypointp->shortname; - c = strlen(sn); + c = sn ? strlen(sn) : 0; fwrite(&c, 1, 1, mapsend_file_out); fwrite(sn, c, 1, mapsend_file_out); @@ -496,7 +496,7 @@ mapsend_route_disp(const waypoint *waypointp) route_wp_count++; /* waypoint name */ - c = strlen(waypointp->shortname); + c = waypointp->shortname ? strlen(waypointp->shortname) : 0; fwrite(&c, 1, 1, mapsend_file_out); fwrite(waypointp->shortname, c, 1, mapsend_file_out); -- 2.30.2